package cn.bbs.controller;

import cn.bbs.pojo.BbsSort;
import cn.bbs.pojo.Detail;
import cn.bbs.service.BbsSortService;
import cn.bbs.service.DetailService;
import com.alibaba.fastjson.JSON;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BbsSortController {
    @Reference
    private BbsSortService bbsSortService;
    @Reference
    private DetailService detailService;

    @RequestMapping("/selectSort.do")
    @ResponseBody
    public String select(){
        List<BbsSort> list=bbsSortService.selectAll();
        return JSON.toJSONString(list);
    }

    @RequestMapping("/selectdetail.do")
    @ResponseBody
    public String selectDetail(){
        List<Detail> detailList=detailService.selectAllDetail();
        return JSON.toJSONString(detailList);
    }


}
